package com.mvpandroiddemo.base;

import com.google.gson.Gson;

/**
 * @Description $description$
 * @Author owner
 * @CreateTime 2019/10/15 16:33
 * <p>
 * {
 * "data": null,
 * "errorCode": -1,
 * "errorMsg": "密码长度必须大于6位！"
 * }
 **/
public class BaseBean<T> {

    private T data;

    private int errorCode;

    private String errorMsg;

    public BaseBean(T data, int errorCode, String errorMsg) {
        this.data = data;
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    public BaseBean() {
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public int getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(int errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    @Override
    public String toString() {
        Gson gson = new Gson();
        return gson.toJson(this);
    }
}
